package com.ls.blog.api;

import com.ls.blog.vo.ArchiveVo;
import com.ls.blog.vo.ArticleVo;
import com.ls.blog.vo.params.ArticleParam;
import com.ls.blog.vo.params.PageParams;

import java.util.List;
import java.util.Map;

/**
 * @program: myblog
 * @author: lishun
 * @create: 2021-07-05 00:00
 **/
public interface ArticleService {

    /**
     * 根据分页参数返回分页数据
     * @param pageParams
     * @return
     */
    List<ArticleVo> listArticlesPage(PageParams pageParams);

    /**
     * 最热文章
     * @param limit
     */
    List<ArticleVo> hotArticles(int limit);

    /**
     * 最新文章
     * @param limit
     * @return
     */
    List<ArticleVo> newArticles(int limit);

    /**
     * 文章归档
     * @return
     */
    ArchiveVo listArchives(Integer current) throws Exception;

    /**
     * 根据id查找文章
     * @param id
     * @return
     */
    ArticleVo findArticleById(Long id);

    /**
     * 根据文章id添加评论数量
     * @param articleId
     */
    void addCommentCountsByArticleId(Long articleId);

    /**
     * 发布文章
     * @param articleParam
     * @return
     */
    Long publish(ArticleParam articleParam);

    Map<String,Object> categoryArticles(Long id, Long current);

    Map<String, Object> tagArticles(Long id, Long current);
}
